<html style="background: white; height: 100%;">
	<head>
	    <meta charset="utf-8" />
	    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
	    <meta content="yes" name="apple-mobile-web-app-capable" />
	    <meta content="yes" name="apple-touch-fullscreen" />
	    <meta content="telephone=no,email=no" name="format-detection" />
	    <meta content="maximum-dpr=2" name="flexible" />
	    <meta content="modeName=750-12" name="grid" />
		  <title>力沃活动提醒 </title>
	    <link href="static/css/style.css" rel="stylesheet" />
	    <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
	</head>
	<body style="height: 100%; overflow: hidden" onclick="window.external.CloseWindow()">
    <div style="padding-top: 50px;" >
        <h1 style="text-align: center" id="act_name"></h1>
        <div style="text-align: center; font-size: 100px; font-weight: bold; padding: 10px;">
          <span id="act_day"></span>
          <span style="font-size: 26px">天</span>
        </div>
    </div>
	</body>
</html>
<script type="text/javascript">

  var url = "http://code.livifa.com:8088/app/reminder";
  var remindList = null;
  var remindOne = null;


      $.ajax({url: url, success:function(result){
          remindList = result.data;
          if(remindList.length>0){
            remindOne = remindList[0]
            $("#act_name").html(remindOne.remark);
            $("#act_day").html(getDay());
            window.external.ShowActTip();
          }else{
            $("#act_name").html("当前无活动");
          }
        }});


  function getDay(){
    if(remindOne){
      var str = remindOne.endDate.replace(/-/g, '/');
      var endDate = new Date(str);
      return Math.ceil(getDays(endDate, new Date()));
    }
    return 0
  }

  function getDays(date1,date2){
    return (date1.getTime()-date2.getTime())/(3600*24*1000);
  }
	</script>
